<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>视频管理</title>
<include file="./Apps/BoxAdmin/View/Public/header.html" />
</head>
<body>
 
    
 
        <div class="list_vmall_man">
        	<div class="list_vmall_le">
            	<!-- <p class="list_vmall_bin"><a href="<{:U('level')}>" target="_black">会员等级管理</a></p> -->
                  <include file="./Apps/BoxAdmin/View/Public/adminMenu.html" />
               
            </div>
            <div class="list_vmall_rig" >
          
 <section class="content">
        <div class="page-content" >
            <ul class="breadcrumb">
				 <li><b>视频管理</b> </li>
			</ul>
    <div class="panel panel-default">
        <div class="panel-body">
            <div id="toolbar" style="width: 100%;">
                <form id="filter" method="get"  class="form-horizontal">
                    <div class="form-group">
                        <div class="col-sm-3">
                            <input type="text" name="kw"  value="<{$kw}>" class="form-control" placeholder="标题">
                        </div>
						 <div class="col-sm-3" style="width:auto">
                           课程：<select name="subjectid" onchange="get_ajax_section(this)" >
						   <option value="">全部</option>
                        		<volist name="subject_list" id="vo">
<option  <if condition="$subjectid eq $vo['subjectid']">selected="selected"</if>" value="<{$vo['subjectid']}>"><{$vo.subject}></option>
 </volist>       
						    
						   </select>
						  </div>
						     <div class="col-sm-3">章节：<select name="sectionid" id="get_ajax_section_sel">
						    <option value="">全部</option>
						   <volist name="sections_list" id="vo">
<option  <if condition="$vo['sectionid'] eq $sectionid">selected="selected"</if>" value="<{$vo['sectionid']}>"><{$vo.section}></option>
 </volist>
						   </select>
                        </div>
						<div class="col-sm-4" style="float:right; width:auto">
                            <input type="submit" class="btn btn-primary pull-right" value="筛选">
                        </div>
						
						 
                    </div>
                    <div class="form-group">
                        <div class="col-sm-8">
                            <a href="<{:U('Subject/add_video')}>" class="btn btn-default"> <i class="fa fa-plus"></i>添加视频</a>
                        </div>
                         
                    </div>
                </form>
            </div>
            <div class="bootstrap-table"> <div class="fixed-table-container" style="padding-bottom: 0px;"> <div class="fixed-table-body"> 
			<table id="data-table" class="table"><thead>
			<tr>
			 
			<th style="" data-field="id"><div class="th-inner sortable both desc">ID</div><div class="fht-cell"></div></th>
			<th style="" data-field="name"><div class="th-inner ">视频标题</div><div class="fht-cell"></div></th> 
			<th style="" data-field="name"><div class="th-inner ">课程</div><div class="fht-cell"></div></th> 
			<th style="" data-field="name"><div class="th-inner ">章节</div><div class="fht-cell"></div></th> 
			<th style="" data-field="name"><div class="th-inner ">时长</div><div class="fht-cell"></div></th> 
			<th style="" data-field="name"><div class="th-inner ">转码状态</div><div class="fht-cell"></div></th> 
			<th style="" data-field="name"><div class="th-inner ">状态</div><div class="fht-cell"></div></th> 
			<th style="" data-field="name"><div class="th-inner ">添加时间</div><div class="fht-cell"></div></th> 
			<th style="" data-field="id"><div class="th-inner ">操作</div><div class="fht-cell"></div></th>
			</tr></thead>
			<tbody>
			<volist name="data" id="vo">
			<tr data-index="<{$i}>">
			<td style=""><{$vo.video_id}></td>
			<td style=""><{$vo.title}></td>
			<td style=""><{$vo.subject.subject}></td>
			<td style=""><{$vo.subject.section}></td>
			<td style=""><{$vo.duration}></td>
			<td style=""><{$vo.transcoding}></td>
			<td style=""><{$vo['status']==1?"启用":"禁用"}></td>
 
			<td style=""><{$vo.add_time}></td>

			<td style="">
			<a href="<{:U('Subject/add_video',array('video_id'=>$vo['video_id']))}>" class="btn btn-primary btn-xs">编辑</a>&nbsp;&nbsp;
			<a href="<{:U('Subject/status_video',array('video_id'=>$vo['video_id']))}>" class="btn btn-primary btn-xs delete-this"><{$vo['is_show']==1?"禁用":"启用"}></a>
			 
			&nbsp;&nbsp;<a href="<{:U('Subject/del_video',array('video_id'=>$vo['video_id']))}>" class="btn btn-primary btn-xs delete-this">删除</a>
			
			 
			</td>
			</tr>
			</volist>
			</tbody></table>
			 </div> 

			</div></div><div class="clearfix"></div>
        </div>
    </div>
     

        </div>
    </section>
                
                </div>
			 
            </div>
       
        
    </div>

 
    <!--视频播放窗口-->
    <div id="video-modal" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div id="video-here" style="width: 890px; margin: 5px auto 0px;"></div>
            </div>
        </div>
    </div>
    <!--视频播放窗口 end-->   
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">选择视频</h4>
      </div>
      <div class="modal-body" id="ajax_page_body">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
         
      </div>
    </div>
  </div>
</div>
<script>
		function get_ajax_section(obj){
			var id=$(obj).val();
			$.get("<{:U('get_ajax_section')}>",{type:"_sel",subjectid:id},function(data){
				$("#get_ajax_section_sel").html(data);
			})
			
		}
 /* 预览课程 */
        $('#data-table').on('click','.preview-this',function(){
            var _this = $(this),
            videoid = _this.data('videoid');
            /* 视频播放函数 */
            //	功能：创建播放器flash，需传递所需参数，具体参数请参考api文档
            var swfobj=new SWFObject('http://union.bokecc.com/flash/player.swf', 'playerswf', '890', '600', '8' );
            swfobj.addVariable( "userid" , "{:C('CC_CONF.USER_ID')}" );	//	partnerID,用户id
            swfobj.addVariable( "videoid" , videoid );	//	spark_videoid,视频所拥有的 api id
            swfobj.addVariable( "mode" , "api" );	//	mode, 注意：必须填写，否则无法播放
            swfobj.addVariable( "autostart" , "false" );	//	开始自动播放，true/false
            swfobj.addVariable( "jscontrol" , "true" );	//	开启js控制播放器，true/false

            swfobj.addParam('allowFullscreen','true');
            swfobj.addParam('allowScriptAccess','always');
            swfobj.addParam('wmode','transparent');
            swfobj.write('video-here');

            $('#video-modal').modal();

        });
		

</script>
     
 
</body>
</html>
